package xyz.riceball.demo;

import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobDataMap;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.stereotype.Component;
import xyz.riceball.job.job.RbJob;

import java.time.LocalDateTime;

/**
 * <p>
 * 对外的测试的DemoJob
 * </p>
 *
 * @author xiaovcloud
 * @since 2022/6/15 22:22
 */
@Slf4j
@Component
@DisallowConcurrentExecution
@PersistJobDataAfterExecution
public class DemoJob extends RbJob {
    @Override
    protected void execute(JobDataMap params) {
        int count = Integer.parseInt(params.get("count").toString());
        count++;
        params.put("count",count);
        log.info(params.get("message") + ", Time now is " + LocalDateTime.now() + " count is " + (count));
    }
}
